package com.teziyou.commodity.service;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.apache.thrift.TException;
import org.springframework.stereotype.Service;

import com.alibaba.fastjson.JSON;
import com.mytravel.commodityBridge.service.TicketInfoService;
import com.teziyou.commodity.core.thrift.ConnectionManager;

@SuppressWarnings("rawtypes")
@Service
//public class LineService extends TicketInfoService.Client {
	
public class LineService {
	@Resource(name="productConnectionManager")
	private ConnectionManager connectionManager;
	
	private TicketInfoService.Client client;

	public int findLinesByCount(Map<String, String> paramMap) {
		try {
			return client.findLinesByCount(paramMap);
		} catch (TException e) {
			e.printStackTrace();
			throw new RuntimeException(e);
		}
	}

	public List findLinesByPage(Map<String, String> paramMap) {
		try {
			return JSON.parseArray(client.findLinesByPage(paramMap));
		} catch (TException e) {
			e.printStackTrace();
			throw new RuntimeException(e);
		}
	}
	
}
